package com.taijihuabao.modules.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.Date;
import java.util.List;

/**
 * 日志模板
 *
 * @author Tu
 * @date 2022/1/19 10:17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ToString(callSuper = true)
@ApiModel("日志模板")
@Document("journal_model")
public class JournalModelMongoEntity {

    /**
     * 主键
     */
    @Id
    private String id;

    /**
     * 编码
     */
    @Field(value = "code")
    private String code;

    /**
     * 标题
     */
    @Field(value = "modelTitle")
    private String modelTitle;

    /**
     * 字段集合
     */
    @Field(value = "fields")
    private List<ModelFieldsEntity> fields;

    /**
     * 创建时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy/MM/dd", timezone = "GMT+8")
    @Field(value = "creator_time")
    private Date creatorTime;

}
